package square.data;

import pedrosm.data.Data;

/**
 * 
 * @author Pedro Silva Moreira
 */
public class MapData extends Data {
	private LocationData[][][] locations;

	// Shortcuts
	public LocationData getLocation(int x, int y, int z) {
		if (x < 0 || y < 0 || x >= this.getWidth() || y >= this.getHeight()) {
			return null;
		}
		return this.getLocations()[x][y][z];
	}

	public int getWidth() {
		return this.getLocations().length;
	}

	public int getHeight() {
		if (this.getLocations().length == 0) {
			return 0;
		}
		return this.getLocations()[0].length;
	}

	public int getThick() {
		if (getHeight() == 0 || this.getLocations()[0].length == 0) {
			return 0;
		}
		return this.getLocations()[0][0].length;
	}

	// Get & Set
	public LocationData[][][] getLocations() {
		return locations;
	}

	public void setLocations(LocationData[][][] locations) {
		this.locations = locations;
	}
}
